#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "dominion.h"
#include "rngs.h"

void testIsGameOver(){
	int k[10] = {adventurer, council_room, feast, gardens, mine,
	       remodel, smithy, village, baron, great_hall};
	
	struct gameState *game = newGame();
	initializeGame(3, k, 10, game);
	struct gameState *test = malloc(sizeof(struct gameState));
	memcpy(test, game, sizeof(struct gameState));
	
	if(!isGameOver(test))
		printf("isGameOver(): PASS when game is not over\n");
	else
		printf("isGameOver(): FAIL when game is not over\n");
	
	test->supplyCount[province] = 0;
	if(isGameOver(test))
		printf("isGameOver(): PASS when provinces run out\n");
	else
		printf("isGameOver(): FAIL when provinces run out\n");
	
	int i, card;
	for(i = 0; i < 3; ++i){
		card = floor(Random()*25); 
		while(game->supplyCount[card] == 0){
			card = floor(Random()*25); 
		}
		game->supplyCount[card] = 0;
	}
	if(isGameOver(test))
		printf("isGameOver(): PASS when 3 supply cards run out\n");
	else
		printf("isGameOver(): FAIL when 3 supply cards run out\n");
		
}



int main(int argc, char *argv[]){
    testIsGameOver();
    return 0;
}


